
package com.starshineworks.util.actions;

import com.starshineworks.util.Emailer;

//import com.starshineworks.entities.UserDAO;

import java.util.Map;

import javax.servlet.http.HttpServlet;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import javax.servlet.http.HttpSession;

public class ActionTeamPage extends Action {
    
    @Override
    public boolean perform(HttpServletRequest  request, 
                           HttpServletResponse resp,
                           HttpServlet         serv, 
                           boolean             isMultiPart)
  {  
        Map<String,String[]> map = request.getParameterMap();
        HttpSession sess = request.getSession();
        Integer uId = (Integer) sess.getAttribute("uId");
        if (uId != null) {
            /* XXXXX
            UserDAO udao = new UserDAO(uId);
            String uName = udao.getUsernameOfId();
            (new Emailer()).send(uName, "Subject TBD", "DATA");
            * */
            return true;
        }
        return false;
    }
    
    @Override
    public String getNextPage() {
        return "User";
    }
    
    public String getError() {
        return "Request cannot be completed.";
    }

}



